package bl;

import java.math.BigInteger;

public class IntegersClientData implements ClientDataI {

	BigInteger identityPublicParameter;
	BigInteger identitySecretParameter;

	public IntegersClientData(IntegersPublicParameters ipp) {
		// Generate secret identity parameter:
		this.identitySecretParameter = Common.randBigInteger(ipp.G,
				ipp.bitLength - 1);
		this.identityPublicParameter = ipp.g.modPow(
				this.identitySecretParameter, ipp.G);
	}

	public IntegersClientData(BigInteger identityPublicParameter) {
		this.identityPublicParameter = identityPublicParameter;
		this.identitySecretParameter = null;
	}

	public IntegersClientData(BigInteger identityPublicParameter,
			BigInteger identitySecretParameter) {
		this.identityPublicParameter = identityPublicParameter;
		this.identitySecretParameter = identitySecretParameter;
	}

	@Override
	public Object getIdentityPublicParameter() {
		return this.identityPublicParameter;
	}

	@Override
	public Object getIdentitySecretParameter() {
		return this.identitySecretParameter;
	}

}
